package node.java;

import com.google.common.base.Joiner;

/**
 * Created by thormentor on 27-04-2014.
 */
public class JavaMethod {
    private final String annotation;
    private final String name;

    public JavaMethod(JavaClass javaClass, String name, String annotation) {
        this.name = name;
        this.annotation = annotation;
        if (annotation != null)
            javaClass.addImport("entity.entity.entity_model.model.annotations.*");
    }

    @Override
    public String toString() {
        return Joiner.on("\n").skipNulls().join(
                annotation,
                String.format("\tvoid %s(){", name),
                "\t}"
        );
    }

}
